package com.xiaoshuidi.cloud.module.member.api.message;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.module.member.api.message.dto.MemberMessageDTO;
import com.xiaoshuidi.cloud.module.member.service.message.MemberMessageService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import static com.xiaoshuidi.cloud.module.system.enums.ApiConstants.VERSION;

@Tag(name = "RPC 服务 - 消息")
@Slf4j
@RestController
@DubboService(version = VERSION)
@Validated
@RequiredArgsConstructor
public class MemberMessageApiImpl implements MemberMessageApi {
    private final MemberMessageService memberMessageService;

    @Override
    public CommonResult<Boolean> create(MemberMessageDTO message) {
        return CommonResult.success(memberMessageService.create(message));
    }
}
